package com.no1.zy.rabbitmq.simple;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(){
        String msg ="simpple queue!";
        System.out.println("生产者发送消息 msg——》"+msg);
        amqpTemplate.convertAndSend("my_simple_queue",msg);
    }
}
